}
/**
- * _handleError:
- * @param {Gio.DBusMethodInvocation}
- * @param {Error}
- *
* Complete @invocation with an appropriate error if @error is set;
* useful for implementing early returns from method implementations.
*
+ * @param {Gio.DBusMethodInvocation}
+ * @param {Error}
+ *
* @returns {bool} - true if @invocation was completed
*/
let _loginManager = null;
/**
- * getLoginManager:
* An abstraction over systemd/logind and ConsoleKit.
+ *
* @returns {LoginManagerSystemd | LoginManagerDummy} - the LoginManager singleton
*/
export function getLoginManager() {
/**
* @private
- * @param {Object} obj - an object
+ * @param {object} obj - an object
* @returns {bool} - true if obj has a 'destroy' GObject signal
*/
function _hasDestroySignal(obj) {
}
/**
- * @param {Object} obj - object to get signal tracker for
+ * @param {object} obj - object to get signal tracker for
* @returns {SignalTracker} - the signal tracker for object
*/
getSignalTracker(obj) {
}
/**
- * @param {Object} obj - object to get signal tracker for
+ * @param {object} obj - object to get signal tracker for
* @returns {?SignalTracker} - the signal tracker for object if it exists
*/
maybeGetSignalTracker(obj) {
}
/*
- * @param {Object} obj - object to remove signal tracker for
+ * @param {object} obj - object to remove signal tracker for
* @returns {void}
*/
removeSignalTracker(obj) {
class SignalTracker {
/**
- * @param {Object=} owner - object that owns the tracker
+ * @param {object=} owner - object that owns the tracker
*/
constructor(owner) {
if (_hasDestroySignal(owner))
/**
* @private
- * @param {Object} obj - a tracked object
+ * @param {object} obj - a tracked object
* @returns {SignalData} - signal data for object
*/
_getSignalData(obj) {
}
/**
- * @param {Object} obj - tracked object
+ * @param {object} obj - tracked object
* @param {...number} handlerIds - tracked handler IDs
* @returns {void}
*/
}
/**
- * @param {Object} obj - tracked object instance
+ * @param {object} obj - tracked object instance
* @returns {void}
*/
untrack(obj) {
* Disconnect all signals that were connected for
* the specified tracked object
*
- * @param {Object} thisObj - the emitter object
- * @param {Object} obj - the tracked object
+ * @param {object} thisObj - the emitter object
+ * @param {object} obj - the tracked object
* @returns {void}
*/
export function disconnectObject(thisObj, obj) {
}
/**
- * appendMessage:
- * @param {Object} message: An object with the properties
- * {string} message.text: the body of the message,
- * {Tp.ChannelTextMessageType} message.messageType: the type
- * {string} message.sender: the name of the sender,
- * {number} message.timestamp: the time the message was sent
- * {NotificationDirection} message.direction: a #NotificationDirection
+ * @param {object} message - An object with the properties
+ * {string} message.text - the body of the message,
+ * {Tp.ChannelTextMessageType} message.messageType - the type
+ * {string} message.sender - the name of the sender,
+ * {number} message.timestamp - the time the message was sent
+ * {NotificationDirection} message.direction - a #NotificationDirection
*
- * @param {bool} noTimestamp: Whether to add a timestamp. If %true,
+ * @param {bool} noTimestamp - Whether to add a timestamp. If %true,
* no timestamp will be added, regardless of the difference since
* the last timestamp
*/
}
/**
- * _append:
- * @param {Object} props: An object with the properties:
- * {string} props.body: The text of the message.
- * {string} props.group: The group of the message, one of:
+ * @param {object} props - An object with the properties:
+ * {string} props.body - The text of the message.
+ * {string} props.group - The group of the message, one of:
* 'received', 'sent', 'meta'.
- * {string[]} props.styles: Style class names for the message to have.
- * {number} props.timestamp: The timestamp of the message.
- * {bool} props.noTimestamp: suppress timestamp signal?
+ * {string[]} props.styles - Style class names for the message to have.
+ * {number} props.timestamp - The timestamp of the message.
+ * {bool} props.noTimestamp - suppress timestamp signal?
*/
_append(props) {
let currentTime = Date.now() / 1000;
}
/**
- * fakeRelease:
- *
* Fake a release event.
* Must be called if you want to intercept release events on draggable
* actors for other purposes (for example if you're using
}
/**
- * startDrag:
- * @param {number} stageX: X coordinate of event
- * @param {number} stageY: Y coordinate of event
- * @param {number} time: Event timestamp
- * @param {Clutter.EventSequence=} sequence: Event sequence
- * @param {Clutter.InputDevice=} device: device that originated the event
- *
* Directly initiate a drag and drop operation from the given actor.
* This function is useful to call if you've specified manualMode
* for the draggable.
+ *
+ * @param {number} stageX - X coordinate of event
+ * @param {number} stageY - Y coordinate of event
+ * @param {number} time - Event timestamp
+ * @param {Clutter.EventSequence=} sequence - Event sequence
+ * @param {Clutter.InputDevice=} device - device that originated the event
*/
startDrag(stageX, stageY, time, sequence, device) {
if (currentDraggable)
}
/**
- * makeDraggable:
- * @param {Clutter.Actor} actor Source actor
- * @param {object} [params] Additional parameters
- * @returns {_Draggable} a new Draggable
- *
* Create an object which controls drag and drop for the given actor.
*
* If %manualMode is %true in @params, do not automatically start
* succeeds, the actor scale and opacity aren't reset; if the drop
* target wants to reuse the actor, it's up to the drop target to
* reset these values.
+ *
+ * @param {Clutter.Actor} actor Source actor
+ * @param {object} [params] Additional parameters
+ * @returns {_Draggable} a new Draggable
*/
export function makeDraggable(actor, params) {
return new _Draggable(actor, params);
}
/**
- * getCrosshairsThickness:
* Get the crosshairs thickness.
*
* @returns {number} The width of the vertical and horizontal
}
/**
- * setCrosshairsOpacity:
- *
* @param {number} opacity Value between 0.0 (transparent)
* and 1.0 (fully opaque).
*/
}
/**
- * getCrosshairsOpacity:
* @returns {number} Value between 0.0 (transparent) and 1.0 (fully opaque).
*/
getCrosshairsOpacity() {
}
/**
- * setCrosshairsLength:
- *
* Set the crosshairs length for all ZoomRegions.
*
* @param {number} length The length of the vertical and horizontal
}
/**
- * addToZoomRegion
- * Either add the crosshairs actor to the given ZoomRegion, or, if it is
- * already part of some other ZoomRegion, create a clone of the crosshairs
- * actor, and add the clone instead. Returns either the original or the
- * clone.
- *
- * @param {ZoomRegion} zoomRegion The container to add the crosshairs
- * group to.
- * @param {Clutter.Actor} magnifiedMouse The mouse actor for the
- * zoom region -- used to position the crosshairs and properly
- * layer them below the mouse.
- * @returns {Clutter.Actor} The crosshairs actor, or its clone.
- */
+ * Either add the crosshairs actor to the given ZoomRegion, or, if it is
+ * already part of some other ZoomRegion, create a clone of the crosshairs
+ * actor, and add the clone instead. Returns either the original or the
+ * clone.
+ *
+ * @param {ZoomRegion} zoomRegion The container to add the crosshairs
+ * group to.
+ * @param {Clutter.Actor} magnifiedMouse The mouse actor for the
+ * zoom region -- used to position the crosshairs and properly
+ * layer them below the mouse.
+ * @returns {Clutter.Actor} The crosshairs actor, or its clone.
+ */
addToZoomRegion(zoomRegion, magnifiedMouse) {
let crosshairsActor = null;
if (zoomRegion && magnifiedMouse) {
}
/**
- * getThemeStylesheet:
- *
* Get the theme CSS file that the shell will load
*
* @returns {?Gio.File}: A #GFile that contains the theme CSS,
}
/**
- * setThemeStylesheet:
- * @param {string=} cssStylesheet: A file path that contains the theme CSS,
- * set it to null to use the default
- *
* Set the theme CSS file that the shell will load
+ *
+ * @param {string=} cssStylesheet - A file path that contains the theme CSS,
+ * set it to null to use the default
*/
export function setThemeStylesheet(cssStylesheet) {
_cssStylesheet = cssStylesheet ? Gio.File.new_for_path(cssStylesheet) : null;
}
/**
- * notify:
- *
* @param {string} msg A message
* @param {string} details Additional information
*/
}
/**
- * notifyError:
- * @param {string} msg: An error message
- * @param {string} details: Additional information
- *
* See shell_global_notify_problem().
+ *
+ * @param {string} msg - An error message
+ * @param {string} details - Additional information
*/
export function notifyError(msg, details) {
// Also print to stderr so it's logged somewhere
}
/**
- * _findModal:
- *
+ * @private
* @param {Clutter.Grab} grab - grab
- *
- * Private function.
- *
*/
function _findModal(grab) {
for (let i = 0; i < modalActorFocusStack.length; i++) {
}
/**
- * pushModal:
- * @param {Clutter.Actor} actor: actor which will be given keyboard focus
- * @param {Object=} params: optional parameters
- *
* Ensure we are in a mode where all keyboard and mouse input goes to
* the stage, and focus @actor. Multiple calls to this function act in
* a stacking fashion; the effect will be undone when an equal number
* modal stack returns to this actor, reset the focus to the actor
* which was focused at the time pushModal() was invoked.
*
- * @params may be used to provide the following parameters:
+ * `params` may be used to provide the following parameters:
* - timestamp: used to associate the call with a specific user initiated
* event. If not provided then the value of
* global.get_current_time() is assumed.
* global keybindings; the default of NONE will filter
* out all keybindings
*
- * @returns {Clutter.Grab}: the grab handle created
+ * @param {Clutter.Actor} actor - actor which will be given keyboard focus
+ * @param {object=} params - optional parameters
+ * @returns {Clutter.Grab} - the grab handle created
*/
export function pushModal(actor, params) {
params = Params.parse(params, {
}
/**
- * popModal:
- * @param {Clutter.Grab} grab - the grab given by pushModal()
- * @param {number=} timestamp - optional timestamp
- *
* Reverse the effect of pushModal(). If this invocation is undoing
* the topmost invocation, then the focus will be restored to the
* previous focus at the time when pushModal() was invoked.
*
- * @timestamp is optionally used to associate the call with a specific user
+ * `timestamp` is optionally used to associate the call with a specific user
* initiated event. If not provided then the value of
* global.get_current_time() is assumed.
+ *
+ * @param {Clutter.Grab} grab - the grab given by pushModal()
+ * @param {number=} timestamp - optional timestamp
*/
export function popModal(grab, timestamp) {
if (timestamp === undefined)
}
/**
- * initializeDeferredWork:
- * @param {Clutter.Actor} actor: an actor
- * @param {callback} callback: Function to invoke to perform work
- *
* This function sets up a callback to be invoked when either the
* given actor is mapped, or after some period of time when the machine
* is idle. This is useful if your actor isn't always visible on the
* initialization as well, under the assumption that new actors
* will need it.
*
- * @returns {string}: A string work identifier
+ * @param {Clutter.Actor} actor - an actor
+ * @param {callback} callback - Function to invoke to perform work
+ *
+ * @returns {string} - A string work identifier
*/
export function initializeDeferredWork(actor, callback) {
// Turn into a string so we can use as an object property
* @param {Cogl.Texture} texture - The texture to take the screenshot from.
* @param {number[4]} [geometry] - The region to use: x, y, width and height.
* @param {number} scale - The texture scale.
- * @param {Object} [cursor] - Cursor data to include in the screenshot.
+ * @param {object} [cursor] - Cursor data to include in the screenshot.
* @param {Cogl.Texture} cursor.texture - The cursor texture.
* @param {number} cursor.x - The cursor x coordinate.
* @param {number} cursor.y - The cursor y coordinate.
//
/**
- * sleep:
- * @param {number} milliseconds - number of milliseconds to wait
- * @returns {Promise} that resolves after @milliseconds ms
- *
* Used within an automation script to pause the the execution of the
* current script for the specified amount of time. Use as
* 'yield Scripting.sleep(500);'
+ *
+ * @param {number} milliseconds - number of milliseconds to wait
+ * @returns {Promise} that resolves after @milliseconds ms
*/
export function sleep(milliseconds) {
return new Promise(resolve => {
}
/**
- * waitLeisure:
- * @returns {Promise} that resolves when the shell is idle
- *
* Used within an automation script to pause the the execution of the
* current script until the shell is completely idle. Use as
* 'yield Scripting.waitLeisure();'
+ *
+ * @returns {Promise} that resolves when the shell is idle
*/
export function waitLeisure() {
return new Promise(resolve => {
}
/**
- * Eval:
- * @param {string} code A string containing JavaScript code
- * @returns {Array}
- *
* This function executes arbitrary code in the main
* loop, and returns a boolean success and
* JSON representation of the object as a string.
* If evaluation fails, then the return value will be
* [false, JSON.stringify(exception)];
*
+ * @param {string} code A string containing JavaScript code
+ * @returns {Array}
*/
Eval(code) {
if (!global.context.unsafe_mode)
}
/**
- * AskPassword:
+ * The dialog will stay visible until clients call the Close() method, or
+ * another dialog becomes visible.
+ * Calling AskPassword again for the same id will have the effect to clear
+ * the existing dialog and update it with a message indicating the previous
+ * attempt went wrong.
+ *
* @param {Array} params
* {string} id: an opaque ID identifying the object for which
* the operation is requested
* - "password_save" -> (u): a GPasswordSave
* @param {Gio.DBusMethodInvocation} invocation
* The ID must be unique in the context of the calling process.
- *
- * The dialog will stay visible until clients call the Close() method, or
- * another dialog becomes visible.
- * Calling AskPassword again for the same id will have the effect to clear
- * the existing dialog and update it with a message indicating the previous
- * attempt went wrong.
*/
AskPasswordAsync(params, invocation) {
let [id, message, iconName_, defaultUser_, defaultDomain_, flags] = params;
}
/**
- * AskQuestion:
+ * The dialog will stay visible until clients call the Close() method, or
+ * another dialog becomes visible.
+ * Calling AskQuestion again for the same id will have the effect to clear
+ * update the dialog with the new question.
+ *
* @param {Array} params - params
* {string} id: an opaque ID identifying the object for which
* the operation is requested
* {string} icon_name: the name of an icon to display
* {string[]} choices: an array of choice strings
* @param {Gio.DBusMethodInvocation} invocation - invocation
- *
- * The dialog will stay visible until clients call the Close() method, or
- * another dialog becomes visible.
- * Calling AskQuestion again for the same id will have the effect to clear
- * update the dialog with the new question.
*/
AskQuestionAsync(params, invocation) {
let [id, message, iconName_, choices] = params;
}
/**
- * ShowProcesses:
+ * The dialog will stay visible until clients call the Close() method, or
+ * another dialog becomes visible.
+ * Calling ShowProcesses again for the same id will have the effect to clear
+ * the existing dialog and update it with the new message and the new list
+ * of processes.
+ *
* @param {Array} params - params
* {string} id: an opaque ID identifying the object for which
* the operation is requested
* {number[]} application_pids: the PIDs of the applications to display
* {string[]} choices: an array of choice strings
* @param {Gio.DBusMethodInvocation} invocation - invocation
- *
- * The dialog will stay visible until clients call the Close() method, or
- * another dialog becomes visible.
- * Calling ShowProcesses again for the same id will have the effect to clear
- * the existing dialog and update it with the new message and the new list
- * of processes.
*/
ShowProcessesAsync(params, invocation) {
let [id, message, iconName_, applicationPids, choices] = params;
}
/**
- * Close:
- * @param {Array} _params - params
- * @param {Gio.DBusMethodInvocation} _invocation - invocation
- *
* Closes a dialog previously opened by AskPassword, AskQuestion or ShowProcesses.
* If no dialog is open, does nothing.
+ *
+ * @param {Array} _params - params
+ * @param {Gio.DBusMethodInvocation} _invocation - invocation
*/
Close(_params, _invocation) {
this._clearCurrentRequest(Gio.MountOperationResult.UNHANDLED, {});
}
/**
- * confirmSwipe:
- * @param {number} distance: swipe distance in pixels
- * @param {number[]} snapPoints:
- * An array of snap points, sorted in ascending order
- * @param {number} currentProgress: initial progress value
- * @param {number} cancelProgress: the value to be used on cancelling
- *
* Confirms a swipe. User has to call this in 'begin' signal handler,
* otherwise the swipe wouldn't start. If there's an animation running,
* it should be stopped first.
*
- * @cancel_progress must always be a snap point, or a value matching
+ * `cancelProgress` must always be a snap point, or a value matching
* some other non-transient state.
+ *
+ * @param {number} distance - swipe distance in pixels
+ * @param {number[]} snapPoints - An array of snap points, sorted in ascending order
+ * @param {number} currentProgress - initial progress value
+ * @param {number} cancelProgress - the value to be used on cancelling
*/
confirmSwipe(distance, snapPoints, currentProgress, cancelProgress) {
this.distance = distance;
}
/**
- * syncOverlays:
- *
* Synchronizes the overlay state of all window previews.
*/
syncOverlays() {
}
/**
- * addWindow:
- * @param {WindowPreview} window: the window to add
- * @param {Meta.Window} metaWindow: the MetaWindow of the window
- *
- * Adds @window to the workspace, it will be shown immediately if
+ * Adds `window` to the workspace, it will be shown immediately if
* the layout isn't frozen using the layout-frozen property.
*
- * If @window is already part of the workspace, nothing will happen.
+ * If `window` is already part of the workspace, nothing will happen.
+ *
+ * @param {WindowPreview} window - the window to add
+ * @param {Meta.Window} metaWindow - the MetaWindow of the window
*/
addWindow(window, metaWindow) {
if (this._windows.has(window))
}
/**
- * removeWindow:
- * @param {WindowPreview} window: the window to remove
- *
- * Removes @window from the workspace if @window is a part of the
+ * Removes `window` from the workspace if `window` is a part of the
* workspace. If the layout-frozen property is set to true, the
* window will still be visible until the property is set to false.
+ *
+ * @param {WindowPreview} window - the window to remove
*/
removeWindow(window) {
const windowInfo = this._windows.get(window);
}
});
-/**
- * @metaWorkspace: a #Meta.Workspace, or null
- */
export const Workspace = GObject.registerClass(
class Workspace extends St.Widget {
+ /**
+ * @param {Meta.Workspace} metaWorkspace
+ * @param {number} monitorIndex
+ * @param {OverviewAdjustment} overviewAdjustment
+ */
_init(metaWorkspace, monitorIndex, overviewAdjustment) {
super._init({
style_class: 'window-picker',
DESTROYED: 9,
};
-/**
- * @metaWorkspace: a #Meta.Workspace
- */
export const WorkspaceThumbnail = GObject.registerClass({
Properties: {
'collapse-fraction': GObject.ParamSpec.double(
0, 1, 0),
},
}, class WorkspaceThumbnail extends St.Widget {
+ /**
+ * @param {Meta.Workspace} metaWorkspace
+ * @param {number} monitorIndex
+ */
_init(metaWorkspace, monitorIndex) {
super._init({
clip_to_allocation: true,
-rules:
- jsdoc/check-alignment: off
- jsdoc/check-param-names: off
- jsdoc/check-tag-names: off
- jsdoc/check-types: off
- jsdoc/implements-on-classes: off
- jsdoc/tag-lines: off
- jsdoc/require-jsdoc: off
- jsdoc/require-param: off
- jsdoc/require-param-description: off
- jsdoc/require-param-name: off
- jsdoc/require-param-type: off